package com.lagou.rabbitmq.demo.homework.controller;

import com.lagou.rabbitmq.demo.homework.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * @Author: gule
 * @Date: 2020/10/16
 */
@Controller
public class PayController {

    @Autowired
    private RedisService redisService;

    @RequestMapping("/pay/{orderId}")
    public String pay(@PathVariable String orderId, Model model) {

        // 写数据库
        redisService.payOrderSuc(orderId);

        model.addAttribute("orderId", orderId);
        return "success";
    }

}
